<?php

/*
 * This is to integrate with database...
 */
include '../../include/config.php';
$bid = $_COOKIE['bid'];
$sr = $_POST['sr'];
echo $sr;
$action = $_POST['action'];
$rp = $_POST['rp'];
if ($action == 'insert_012') {
    mysql_query("insert into baby_012_growth (sr, bid) values(NULL,'" . $_COOKIE['bid'] . "')") or die(mysql_error());
    header('Location:' . $rp);
}
if ($action == 'update012') {

    for ($i = 1; $i < 85; $i++) {
        //echo $i.'---->'.$_POST[$i].'<br>';
        mysql_query("update baby_012_growth set `$i` = '".$_POST[$i]."' where  sr = $sr ") or die(mysql_error()) ;
        echo $i.'--->ok<br>';
    }
    //echo '<br><b>Done</b><br>';
    header('Location:' . $rp);
}
?>
